﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace prog_tech_5
{
    public abstract class AudioRecord
    {
        private readonly double _length = 0.0;
        private readonly int _bitPerSample = 24;
        private readonly string _format = "MP3";
        private string _fileName;
        private string _title;
        private int _sampleRate = 44100;
        private int _channels = 2;

        public AudioRecord(string title, double time)
        {
            this._length = time;
            this._title = title;
        }
        public string fileName()
        {
            return _fileName;
        }
        public string title()
        {
            return _title;
        }
        public string format()
        {
            return _format;
        }
        public double length()
        {
            return _length;
        }
        public int bitPerSample()
        {
            return _bitPerSample;
        }
        public int sampleRate()
        {
            return _sampleRate;
        }
        public int channels()
        {
            return _channels;
        }
    }

    public class MusicTrack : AudioRecord
    {
        public MusicTrack(string title, double time)
            : base(title, time)
        {
        }
        public int number;
        public int year;
    }

    public class Podcast : AudioRecord
    {
        public string author;
        public string tag;

        public Podcast(string theme, double time)
            : base(theme, time)
        {
        }
    }

    public interface AudioRecordFactory
    {
        AudioRecord CreateRecord(string title, double time);
    }

    public class MusicTrackFactory : AudioRecordFactory
    {
        public AudioRecord CreateRecord(string title, double time)
        {
            return new MusicTrack(title, time);
        }
    }

    public class PodcastFactory : AudioRecordFactory
    {
        public AudioRecord CreateRecord(string theme, double time)
        {
            return new Podcast(theme, time);
        }
    }

    public class Song : MusicTrack
    {
        public string artist;
        public string genre;
        public string album;
        public Song(string title, double time)
            : base(title, time)
        {
        }
    }

    public class Classic : MusicTrack
    {
        public string composer;
        public string instruments;
        public Classic(string title, double time)
            : base(title, time)
        {
        }
    }

    public interface TracksFactory
    {
        MusicTrack CreateMusicTrack(string title, double time);
    }

    public class SongFactory : TracksFactory
    {
        public MusicTrack CreateMusicTrack(string title, double time)
        {
            return new Song(title, time);
        }
    }

    public class ClassicFactory : TracksFactory
    {
        public MusicTrack CreateMusicTrack(string title, double time)
        {
            return new Classic(title, time);
        }
    }
}
